package com.seal.tsms.base.service;

import com.seal.tsms.base.dao.Pagination;
import com.seal.tsms.school.entity.RelationInfo;
import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.transform.ResultTransformer;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * Created by seal.jing on 2015/12/21.
 */
public interface BaseService<E extends Serializable,PK extends Serializable> {

    void save(E entity);
    void update(E entity);
    void delete(E entity);
    void merge(E entity);
    E get(PK id);
    E findOne(String dsl, Map params);
    E findOne(DetachedCriteria detachedCriteria);
    void browse(Pagination pagination);
    List<?> list(String dsl, Map params,ResultTransformer resultTransformer);
    List<?> list(DetachedCriteria detachedCriteria,ResultTransformer resultTransformer);
    void batch(String named, Map params);



}
